<?php

#基础函数
include_once('_path.php');
include_once("../includes/init.php");

$admin_ids = $_REQUEST['admin_ids'];

#如果admin_ids是
if(!is_array($admin_ids)){
	$admin_ids = array();
	$admin_ids[0] = $_REQUEST['admin_id'];
}

	if(sizeof($admin_ids)){
		foreach ($admin_ids as $admin_id) {
			//$quote['admin_id'] = $database->quote($admin_id);
			if(is_numeric($admin_id)){
				switch ($_REQUEST['type']) {
					case 'lock':
							$database->execute("UPDATE admin SET status = 1 WHERE id = ".$admin_id.";");
							add_log('do_lock', 'admin', "lock admin id is $admin_id");
						break;
					case 'unlock':
						$database->execute("UPDATE admin SET status = 0 WHERE id = ".$admin_id.";");
							add_log('do_unlock', 'admin', "unlock admin id is $admin_id");
						break;
				}
			}
		}
	}

$_REQUEST['referrer'] = "./";
redirect("Updated");
?>